package com.heima.listener;

import com.heima.model.constants.RabbitMQConstants;
import com.heima.model.wemedia.pojos.WmNews;
import com.heima.service.ArticleConfigService;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

/**
 * @author chenshan
 */
@Component
public class RabbitMQListener {
    @Autowired
    private ArticleConfigService articleConfigService;

    @RabbitListener(queues = RabbitMQConstants.RABBITMQ_ENABLE_QUEUE)
    public void listenSimpleQueueMessage(WmNews news) {
        articleConfigService.articleConfigDownOrUp(news);
    }
}
